home *** CD-ROM | disk | FTP | other *** search
/ IRIX Base Documentation 1998 November / IRIX 6.5.2 Base Documentation November 1998.img / usr / share / catman / u_man / cat3 / Tk / getimage.z / getimage
Text File  |  1998-10-30  |  10KB  |  199 lines

  1.  
  2.  
  3.  
  4. TTTTkkkk____GGGGeeeettttIIIImmmmaaaaggggeeee((((3333TTTTkkkk))))                                              TTTTkkkk____GGGGeeeettttIIIImmmmaaaaggggeeee((((3333TTTTkkkk))))
  5.  
  6.  
  7.  
  8. NNNNAAAAMMMMEEEE
  9.      Tk_GetImage, Tk_RedrawImage, Tk_SizeOfImage, Tk_FreeImage - use an image
  10.      in a widget
  11.  
  12. SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.      ####iiiinnnncccclllluuuuddddeeee <<<<ttttkkkk....hhhh>>>>
  14.  
  15.      Tk_Image
  16.      TTTTkkkk____GGGGeeeettttIIIImmmmaaaaggggeeee(_i_n_t_e_r_p, _t_k_w_i_n, _n_a_m_e, _c_h_a_n_g_e_P_r_o_c, _c_l_i_e_n_t_D_a_t_a)
  17.  
  18.      TTTTkkkk____RRRReeeeddddrrrraaaawwwwIIIImmmmaaaaggggeeee(_i_m_a_g_e, _i_m_a_g_e_X, _i_m_a_g_e_Y, _w_i_d_t_h, _h_e_i_g_h_t, _d_r_a_w_a_b_l_e,
  19.       _d_r_a_w_a_b_l_e_X, _d_r_a_w_a_b_l_e_Y)
  20.  
  21.      TTTTkkkk____SSSSiiiizzzzeeeeOOOOffffIIIImmmmaaaaggggeeee(_i_m_a_g_e, _w_i_d_t_h_P_t_r, _h_e_i_g_h_t_P_t_r)
  22.  
  23.      TTTTkkkk____FFFFrrrreeeeeeeeIIIImmmmaaaaggggeeee(_i_m_a_g_e)
  24.  
  25. AAAARRRRGGGGUUUUMMMMEEEENNNNTTTTSSSS
  26.      Tcl_Interp            *_i_n_t_e_r_p       (in)      Place to leave error
  27.                                                    message.
  28.  
  29.      Tk_Window             _t_k_w_i_n         (in)      Window in which image will
  30.                                                    be used.
  31.  
  32.      char                  *_n_a_m_e         (in)      Name of image.
  33.  
  34.      Tk_ImageChangedProc   *_c_h_a_n_g_e_P_r_o_c   (in)      Procedure for Tk to invoke
  35.                                                    whenever image content or
  36.                                                    size changes.
  37.  
  38.      ClientData            _c_l_i_e_n_t_D_a_t_a    (in)      One-word value for Tk to
  39.                                                    pass to _c_h_a_n_g_e_P_r_o_c.
  40.  
  41.      Tk_Image              _i_m_a_g_e                   Token for image instance;
  42.                                                    must have been returned by
  43.                                                    a previous call to
  44.                                                    TTTTkkkk____GGGGeeeettttIIIImmmmaaaaggggeeee.
  45.  
  46.      int                   _i_m_a_g_e_X        (in)      X-coordinate of upper-left
  47.                                                    corner of region of image
  48.                                                    to redisplay (measured in
  49.                                                    pixels from the image's
  50.                                                    upper-left corner).
  51.  
  52.      int                   _i_m_a_g_e_Y        (in)      Y-coordinate of upper-left
  53.                                                    corner of region of image
  54.                                                    to redisplay (measured in
  55.                                                    pixels from the image's
  56.                                                    upper-left corner).
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.                                                                         PPPPaaaaggggeeee 1111
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. TTTTkkkk____GGGGeeeettttIIIImmmmaaaaggggeeee((((3333TTTTkkkk))))                                              TTTTkkkk____GGGGeeeettttIIIImmmmaaaaggggeeee((((3333TTTTkkkk))))
  71.  
  72.  
  73.  
  74.      int                   _w_i_d_t_h         ((in))    Width of region of image to
  75.                                                    redisplay.
  76.  
  77.      int                   _h_e_i_g_h_t        ((in))    Height of region of image
  78.                                                    to redisplay.
  79.  
  80.      Drawable              _d_r_a_w_a_b_l_e      (in)      Where to display image.
  81.                                                    Must either be window
  82.                                                    specified to TTTTkkkk____GGGGeeeettttIIIImmmmaaaaggggeeee or
  83.                                                    a pixmap compatible with
  84.                                                    that window.
  85.  
  86.      int                   _d_r_a_w_a_b_l_e_X     (in)      Where to display image in
  87.                                                    _d_r_a_w_a_b_l_e: this is the x-
  88.                                                    coordinate in _d_r_a_w_a_b_l_e
  89.                                                    where x-coordinate _i_m_a_g_e_X
  90.                                                    of the image should be
  91.                                                    displayed.
  92.  
  93.      int                   _d_r_a_w_a_b_l_e_Y     (in)      Where to display image in
  94.                                                    _d_r_a_w_a_b_l_e: this is the y-
  95.                                                    coordinate in _d_r_a_w_a_b_l_e
  96.                                                    where y-coordinate _i_m_a_g_e_Y
  97.                                                    of the image should be
  98.                                                    displayed.
  99.  
  100.      int                   _w_i_d_t_h_P_t_r      (out)     Store width of _i_m_a_g_e (in
  101.                                                    pixels) here.
  102.  
  103.      int                   _h_e_i_g_h_t_P_t_r     (out)     Store height of _i_m_a_g_e (in
  104.                                                    pixels) here.
  105.  
  106.  
  107. DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  108.      These procedures are invoked by widgets that wish to display images.
  109.      TTTTkkkk____GGGGeeeettttIIIImmmmaaaaggggeeee is invoked by a widget when it first decides to display an
  110.      image.  _n_a_m_e gives the name of the desired image and _t_k_w_i_n identifies the
  111.      window where the image will be displayed.  TTTTkkkk____GGGGeeeettttIIIImmmmaaaaggggeeee looks up the image
  112.      in the table of existing images and returns a token for a new instance of
  113.      the image.  If the image doesn't exist then TTTTkkkk____GGGGeeeettttIIIImmmmaaaaggggeeee returns NULL and
  114.      leaves an error message in _i_n_t_e_r_p->_r_e_s_u_l_t.
  115.  
  116.      When a widget wishes to actually display an image it must call
  117.      TTTTkkkk____RRRReeeeddddrrrraaaawwwwWWWWiiiiddddggggeeeetttt, identifying the image (_i_m_a_g_e), a region within the image
  118.      to redisplay (_i_m_a_g_e_X, _i_m_a_g_e_Y, _w_i_d_t_h, and _h_e_i_g_h_t), and a place to display
  119.      the image (_d_r_a_w_a_b_l_e, _d_r_a_w_a_b_l_e_X, and _d_r_a_w_a_b_l_e_Y).  Tk will then invoke the
  120.      appropriate image manager, which will display the requested portion of
  121.      the image before returning.
  122.  
  123.      A widget can find out the dimensions of an image by calling
  124.      TTTTkkkk____SSSSiiiizzzzeeeeOOOOffffIIIImmmmaaaaggggeeee:  the width and height will be stored in the locations
  125.      given by _w_i_d_t_h_P_t_r and _h_e_i_g_h_t_P_t_r, respectively.
  126.  
  127.  
  128.  
  129.                                                                         PPPPaaaaggggeeee 2222
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. TTTTkkkk____GGGGeeeettttIIIImmmmaaaaggggeeee((((3333TTTTkkkk))))                                              TTTTkkkk____GGGGeeeettttIIIImmmmaaaaggggeeee((((3333TTTTkkkk))))
  137.  
  138.  
  139.  
  140.      When a widget is finished with an image (e.g., the widget is being
  141.      deleted or it is going to use a different image instead of the current
  142.      one), it must call TTTTkkkk____FFFFrrrreeeeeeeeIIIImmmmaaaaggggeeee to release the image instance.  The
  143.      widget should never again use the image token after passing it to
  144.      TTTTkkkk____FFFFrrrreeeeeeeeIIIImmmmaaaaggggeeee.  There must be exactly one call to TTTTkkkk____FFFFrrrreeeeeeeeIIIImmmmaaaaggggeeee for each
  145.      call to TTTTkkkk____GGGGeeeettttIIIImmmmaaaaggggeeee.
  146.  
  147.      If the contents or size of an image changes, then any widgets using the
  148.      image will need to find out about the changes so that they can redisplay
  149.      themselves.  The _c_h_a_n_g_e_P_r_o_c and _c_l_i_e_n_t_D_a_t_a arguments to TTTTkkkk____GGGGeeeettttIIIImmmmaaaaggggeeee are
  150.      used for this purpose.  _c_h_a_n_g_e_P_r_o_c will be called by Tk whenever a change
  151.      occurs in the image;  it must match the following prototype:
  152.           typedef void Tk_ImageChangedProc(
  153.                ClientData _c_l_i_e_n_t_D_a_t_a,
  154.                int _x,
  155.                int _y,
  156.                int _w_i_d_t_h,
  157.                int _h_e_i_g_h_t,
  158.                int _i_m_a_g_e_W_i_d_t_h,
  159.                int _i_m_a_g_e_H_e_i_g_h_t);
  160.      The _c_l_i_e_n_t_D_a_t_a argument to _c_h_a_n_g_e_P_r_o_c is the same as the _c_l_i_e_n_t_D_a_t_a
  161.      argument to TTTTkkkk____GGGGeeeettttIIIImmmmaaaaggggeeee.  It is usually a pointer to the widget record
  162.      for the widget or some other data structure managed by the widget.  The
  163.      arguments _x, _y, _w_i_d_t_h, and _h_e_i_g_h_t identify a region within the image that
  164.      must be redisplayed; they are specified in pixels measured from the
  165.      upper-left corner of the image.  The arguments _i_m_a_g_e_W_i_d_t_h and _i_m_a_g_e_H_e_i_g_h_t
  166.      give the image's (new) size.
  167.  
  168.  
  169. SSSSEEEEEEEE AAAALLLLSSSSOOOO
  170.      Tk_CreateImageType
  171.  
  172.  
  173. KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS
  174.      images, redisplay
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.                                                                         PPPPaaaaggggeeee 3333
  196.  
  197.  
  198.  
  199.